cmake_minimum_required(VERSION 3.0)

option(WITH_CONTROL_CENTER "Build Robot Control Center" ON)
#是否编译TBB
option(WITH_TBB "Build With TBB" ON)
#是否编译REALSENSE
option(WITH_LIBREALSENCE2 "Build With Librealsence" OFF)
#编译测试
option(RC_TEST "Build With test" ON)

#开启下位控制器模式
add_definitions(-D USE_DSP_DEVICE)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_STANDARD 14)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(OpenGL_GL_PREFERENCE GLVND)
set(BUILD_EXAMPLES ON)

add_subdirectory(3rdparty/grpc)
add_subdirectory(3rdparty/gflags)
add_subdirectory(3rdparty/libserv)
if (${WITH_TBB} STREQUAL "OFF")
    add_subdirectory(3rdparty/librealsense)
endif ()
add_subdirectory(3rdparty/websocketpp)

add_subdirectory(tools)
add_subdirectory(robot_client)

if (${WITH_CONTROL_CENTER} STREQUAL "ON")
    add_subdirectory(robot_center)
endif ()

